﻿using Domain.ValueObject;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Domain.Entity
{
    /// <summary>
    /// 用户登录记录实体- 单独的聚合
    /// </summary>
    public class UserLoginHistory:IMyRoot
    {
        private UserLoginHistory() { }

        public UserLoginHistory(Guid? userId,PhoneNumber phone,string msg)
        { 
            this.UserId= userId;
            this.Phone = phone;
            this.Message= msg;
            this.CreateTime = DateTime.Now;
        }


        public long Id { get; init; }
        /// <summary>
        /// 是指向User的外键，但在物理上，并没有创建它们的外键关系
        /// </summary>
        public Guid? UserId { get; init; }
        public PhoneNumber Phone { get; init; } 
        public DateTime CreateTime { get; init; }
        public string Message { get; init; }
    }
}
